Skip to content

Conversation

@chrsow
Copy link

@chrsow chrsow commented Jan 8, 2018

There are two changes in the commit

  1. Use require() and assert() instead of throw for condition checking
  • Since the solidity version from 0.4.10 onwards supports require() and assert().
    Those two function will refunds gas in case of an error occurs.

Ref: http://solidity.readthedocs.io/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions

  1. Change functions modifiers 'view' and pure instead of constant
  • Version 0.4.17 supports view and pure which has more clear leading word than constant.

Ref: http://solidity.readthedocs.io/en/develop/miscellaneous.html#modifiers

@chrsow chrsow changed the title Use "require()" and "assert()" instead "throw" for condition checking Change function modifiers and condition checking instruction Jan 10, 2018
@stonecoldpat
Copy link
Owner

Hey thanks for doing this! I'll test out the changes (and check everything is working with latest solidity) before committing them

@fedorloshakov
Copy link

fedorloshakov commented Jan 26, 2018

@chrsow, how did you compile smart contract? Because I also tried to compile in Etherium Wallet and received warning message:
Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using “switch” or “for” statements instead.
jumpi(end, iszero(bit))
^---^
The same warning for jump assembly command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants